﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class kucunyujing2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<decimal>(
                name: "WarningQtyMax",
                table: "TWarningRules",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "WarningQtyMin",
                table: "TWarningRules",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.CreateTable(
                name: "TInventoryWarn",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MaterialId = table.Column<int>(type: "int", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarnType = table.Column<int>(type: "int", nullable: true),
                    QTY = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WhId = table.Column<int>(type: "int", nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InventoryAlert = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TInventoryWarn", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TInventoryWarn");

            migrationBuilder.DropColumn(
                name: "WarningQtyMax",
                table: "TWarningRules");

            migrationBuilder.DropColumn(
                name: "WarningQtyMin",
                table: "TWarningRules");
        }
    }
}
